package com.shuo.dsa.niuke;

import com.shuo.dsa.model.TreeNode;

/**
 * 二叉树的镜像
 *      思路: 先交换左右节点再对左右节点进行递归
 */
public class MirrorTree {
    public void Mirror(TreeNode root) {
        if (root == null) return;
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
        Mirror(root.right);
        Mirror(root.left);
    }

}
